package com.homework.HomeAcount.util;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

import com.homework.HomeAcount.entity.CurrentUser;

public class ShiroUtil {

	public static CurrentUser getCurrentUser() {
		//从shiro的session中取currentUser
		Subject subject = SecurityUtils.getSubject();
		//取身份信息
		CurrentUser currentUser = (CurrentUser) subject.getPrincipal();
		
		return currentUser;
	}
	
}
